Skip to content

🪲 [Fix]: Module import no longer fails when a newer Admin version is installed#59

Merged
Marius Storhaug (MariusStorhaug) merged 3 commits intomainfrom
fix/58-replace-requiredversion-with-moduleversion
Apr 19, 2026
Merged

🪲 [Fix]: Module import no longer fails when a newer Admin version is installed#59
Marius Storhaug (MariusStorhaug) merged 3 commits intomainfrom
fix/58-replace-requiredversion-with-moduleversion

Conversation

@MariusStorhaug
Copy link
Copy Markdown
Member

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Apr 17, 2026

Importing the Fonts module no longer fails when a newer version of the Admin dependency is installed. Previously, the #Requires directives pinned an exact version (RequiredVersion = '1.1.6'), which caused Import-Module Fonts to error out if only a newer version of Admin was present. The directives now specify a major-pinned range using ModuleVersion and MaximumVersion, accepting any Admin version from 1.1.6 up to (but not including) 2.0.0.

Fixed: Module import fails with newer Admin dependency

The three public functions (Get-Font, Install-Font, Uninstall-Font) used RequiredVersion in their #Requires -Modules directive, demanding an exact version match for the Admin module. This caused Import-Module Fonts to fail when only a newer version of Admin was installed.

The directives now use a major-pinned rangeModuleVersion sets the minimum acceptable version, and MaximumVersion caps at 1.999.999 to prevent a future Admin v2.0.0 (with potential breaking changes) from being used. Any version of Admin from 1.1.6 through 1.x will satisfy the requirement.

# Before (exact pin — fails if 1.1.6 is not installed)
#Requires -Modules @{ ModuleName = 'Admin'; RequiredVersion = '1.1.6' }

# After (major-pinned range — 1.1.6 through 1.x accepted)
#Requires -Modules @{ ModuleName = 'Admin'; ModuleVersion = '1.1.6'; MaximumVersion = '1.999.999' }

Technical Details

  • Changed RequiredVersion to ModuleVersion + MaximumVersion in #Requires -Modules directive in three files:
    • src/functions/public/Get-Font.ps1
    • src/functions/public/Install-Font.ps1
    • src/functions/public/Uninstall-Font.ps1
  • Minimum version stays at 1.1.6 (unchanged from the original RequiredVersion value).
  • MaximumVersion = '1.999.999' added to cap at the 1.x major version range, preventing breakage from a future Admin v2.0.0.
  • Implementation plan progress: Core change tasks (all 3 files) completed. Verification tasks remain for CI.

@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title PR description being generated... 🪲 [Fix]: Module import no longer fails when a newer Admin version is installed Apr 17, 2026
@github-actions
Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@MariusStorhaug Marius Storhaug (MariusStorhaug) marked this pull request as ready for review April 17, 2026 20:15
Copilot AI review requested due to automatic review settings April 17, 2026 20:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Fonts PowerShell module’s Admin dependency constraint so importing the module doesn’t fail when users have a newer Admin version installed (fix for #58).

Changes:

  • Replaced #Requires -Modules RequiredVersion (exact pin) with ModuleVersion (minimum version) for the Admin dependency.
  • Updated the minimum Admin version requirement to 1.1.13 in the three public functions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/functions/public/Get-Font.ps1 Updates #Requires to use minimum Admin version via ModuleVersion.
src/functions/public/Install-Font.ps1 Updates #Requires to use minimum Admin version via ModuleVersion.
src/functions/public/Uninstall-Font.ps1 Updates #Requires to use minimum Admin version via ModuleVersion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/functions/public/Install-Font.ps1 Outdated
Comment thread src/functions/public/Uninstall-Font.ps1 Outdated
Comment thread src/functions/public/Get-Font.ps1 Outdated
Comment thread src/functions/public/Get-Font.ps1 Outdated
@MariusStorhaug
Copy link
Copy Markdown
Member Author

Copilot Please also add a max version so we can support up to 1.999.999. Leave the minimal version on 1.1.6.

Agent-Logs-Url: https://github.com/PSModule/Fonts/sessions/a6dd67f0-d679-4410-ac05-c44e544e6f4d

Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

Copilot Please also add a max version so we can support up to 1.999.999. Leave the minimal version on 1.1.6.

Implemented in 3da6fc8. All three public functions now use #Requires -Modules @{ ModuleName = 'Admin'; ModuleVersion = '1.1.6'; MaximumVersion = '1.999.999' }.

@github-actions
Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@MariusStorhaug Marius Storhaug (MariusStorhaug) merged commit 5d65476 into main Apr 19, 2026
39 checks passed
@MariusStorhaug Marius Storhaug (MariusStorhaug) deleted the fix/58-replace-requiredversion-with-moduleversion branch April 19, 2026 17:08
@github-actions
Copy link
Copy Markdown

✅ New release: PowerShell Gallery - Fonts 1.1.27

@github-actions
Copy link
Copy Markdown

✅ New release: GitHub - Fonts v1.1.27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix module import failure when a newer Admin version is installed

3 participants